package cn.lyh.iotmanage.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author lyh
 * @version 1.0
 * @since 2021/5/15
 */
@Configuration
public class CORSConfig implements WebMvcConfigurer {


	@Override
	public void addCorsMappings(CorsRegistry registry) {
		registry.addMapping("/**").allowedOrigins("*")
				.allowedMethods("GET","HEAD","POST").allowCredentials(true).allowedHeaders("*");
	}
}
